<?php

/**
 * Degree form.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class DegreeForm extends BaseDegreeForm
{
  public function configure()
  {
  	unset( $this['created_at'],  $this['updated_at'] );
	$this->setDefaults( array('created_at' => time(), 'updated_at' => time() ) );
	
//	$level = $this->getObject();
//	if( $level->getLevelStatus() == 0 )
//		$level->setLevelStatus(NULL);
//	$this->widgetSchema['level_status'] = new sfWidgetFormInputCheckbox(array("value_attribute_value" => 1),array('value' => 1));
//	$this->validatorSchema['level_status'] =  new sfValidatorInteger( array('required' => false ));
	$this->widgetSchema->setNameFormat('degree[%s]');
	
	$this->widgetSchema->setLabels(  
		 array(  
			 'degree_name'      => 'Degree Name', 
		 )  
	 );  
//	$lang_current = sfContext::getInstance()->getUser()->getCulture();
//	$this->languages = array($lang_current => $lang_current);
//	$langs = array_keys($this->languages);
//	$this->embedI18n($langs);
//	foreach($this->languages as $lang => $label)
//	{
//	  $this->widgetSchema[$lang]->setLabel($label);
//	}
	//code de cho hien thi * o cac truong require cung add them 2 dong o backend.css
//	$decorator = new sidFormFormatter($this->widgetSchema, $this->validatorSchema);
//   $this->widgetSchema->addFormFormatter('custom', $decorator);
//    $this->widgetSchema->setFormFormatterName('custom');
  }
}
